import 'package:boss/color_constant.dart';
import 'package:boss/textStyle/text_style.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';

class RectButton extends StatelessWidget {
  final String title;
  final VoidCallback onTap;
  final double height;
  final double width;
  final EdgeInsets padding;

  const RectButton({
    Key key,
    @required this.title,
    this.onTap,
    this.width,
    this.height,
    this.padding,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    var paddingBottom = MediaQuery.of(context).padding.bottom;

    return GestureDetector(
      onTap: onTap,
      behavior: HitTestBehavior.translucent,
      child: Container(
        width: width,
        height: height ?? 98.w + paddingBottom,
        padding: padding ??
            EdgeInsets.only(
              bottom: paddingBottom,
            ),
        alignment: Alignment.center,
        color: ColorConstant.ff5770f6,
        child: Text(
          title,
          style: TextStyleConstant().white_32,
        ),
      ),
    );
  }
}
